import Vue from 'vue'
import Router from 'vue-router'
import categoryArticle from '@/components/categoryArticle/index'
import tagArticle from '@/components/tagArticle/index'
import main from '@/components/main/main'
import home from '@/components/home'
import detail from '@/components/detail/detail'
import Person from '@/components/person'
import videoDetail from '@/components/detail/videoDetail'
import resource from '@/components/resource/resource'
import about from '@/components/about/about'
import reward from '@/components/reward/reward'
Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'home',
      component: home
    },
    {
      path: '/index',
      name: 'index',
      component: main,
      children: [
        {
          path: 'search/:word',
          component: main
        }
      ]
    },
    {
      path: '/resource',
      name: 'resource',
      component: resource,
      children: [
        {
          path: 'search/:word',
          component: resource
        }
      ]
    },
    {
      path: '/about',
      name: 'about',
      component: about,
    },
    {
      path: '/index/:page',
      name: 'index',
      component: main
    },
    {
      path: '/category/:code',
      name: 'category',
      component: categoryArticle
    },
    {
      path: '/category/:code/:page',
      name: 'category-code',
      component: categoryArticle
    },
    {
      path: '/tag/:code',
      name: 'tag',
      component: tagArticle
    },
    {
      path: '/tag/:code/:page',
      name: 'tag-code',
      component: tagArticle
    },
    {
      path: '/detail/:code',
      component: detail,
      children: [
        {
          path: 'person',
          component: Person
        }
      ]
    }, {
      path: '/videoDetail/:code',
      component: videoDetail,
      children: [
        {
          path: 'person',
          component: Person
        }
      ]
    },
    {
      path: '/reward/:id',
      component: reward,
      children: [
        {
          path: 'person',
          component: Person
        }
      ]
    }

  ]
})
